package biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import dao.FilesDao;
import entity.Files;
import entity.Folder;
import biz.FilesBiz;

public class FilesBizImpl implements FilesBiz {
	private FilesDao filesDao;
	
	public FilesDao getFilesDao() {
		return filesDao;
	}

	public void setFilesDao(FilesDao filesDao) {
		this.filesDao = filesDao;
	}

	public List<Files> findAll() {
		return filesDao.findAll();
	}

	public Files findById(Integer id) {
		return filesDao.findById(id);
	}

	public int add(Files files) {
		return filesDao.add(files);
	}

	public int delete(Files files) {
		return filesDao.delete(files);
	}

	public int update(Files files) {
		return filesDao.update(files);
	}

	public List<Files> findByParam(Integer pageNo, Integer rows,Map map,Integer folderid) {
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		map.put("folderid", folderid);
		return filesDao.findByParam(map);
	}

	public List<Files> findByPage(Integer pageNo, Integer rows,Integer folderid) {
		Map map = new HashMap();
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		map.put("folderid", folderid);
		return filesDao.findByPage(map);
	}

	public Integer count(Integer folderid) {
		return filesDao.count(folderid);
	}

	
	public Integer count(Map map, Integer folderid) {
		map.put("folderid", folderid);
		return filesDao.count1(map);
	}

	public int updateStatus(Files files) {
		return filesDao.updateStatus(files);
	}

	

	

	



}
